<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>流程定义管理-左边</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/layui_ext/dtree/dtree.css" media="all"/>
    <link rel="stylesheet" href="/layui_ext/dtree/font/dtreefont.css" media="all"/>
</head>
<body>
<ul id="parentTree" class="dtree" data-id="0"></ul>
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript">
    layui.extend({
        dtree: '/layui_ext/dtree/dtree'
    }).use(['dtree', 'jquery'], function () {
        var dtree = layui.dtree;
        var $ = layui.jquery;

        // 初始化树形组件
        var parentTree = dtree.render({
            elem: "#parentTree",
            dataStyle: "layuiStyle",
            dataFormat: "list",
            method: "GET",
            response: { message: "msg", statusCode: 0 },
            url: "/category/tree",
        });

        // 点击节点刷新右侧表格
        dtree.on("node(parentTree)", function (obj) {
            window.parent.right.reloadTable(obj.param.nodeId); // 传递分类ID
        });
    });
</script>
</body>
</html>